﻿using System;
using System.ComponentModel.DataAnnotations;

namespace CodeSystem.Models
{
    public class CodeMd
    {
        public CodeMd()
        {
            this.CreateTime = DateTime.Now.ToShortDateString();
            this.IsShowed = true;
            this.IsValued = false;
            this.ClickCount = 0;
        }
        [Key]
        public int Id { get; set; }
        [MaxLength(100)]
        public string Title { get; set; }
        /// <summary>
        /// 文件类型
        /// </summary>
        public Tag ClassTag { get; set; }
        [MaxLength(50)]
        public string KeyWords { get; set; }
        /// <summary>
        /// 封面地址
        /// </summary>
        [MaxLength(300)]
        public string CoverUrl { get; set; }
        /// <summary>
        /// 内容
        /// </summary>
        public string HtmlContent { get; set; }
        /// <summary>
        /// 网盘地址
        /// </summary>
        [MaxLength(300)]
        public string WpUrl { get; set; }
        /// <summary>
        /// 点击量
        /// </summary>
        public int ClickCount { get; set; }
        /// <summary>
        /// 发布日期
        /// </summary>
        [MaxLength(100)]
        public string CreateTime { get; set; }
        /// <summary>
        /// 是否显示，默认true
        /// </summary>
        public bool IsShowed { get; set; }
        /// <summary>
        /// 是否加精，默认false
        /// </summary>
        public bool IsValued { get; set; }
    }
    public enum Tag
    {
        SOFTCODE=1,//软件源码
        LEARNFILE=2,//学习文件
        ELSE=3 //其他
    }
}